package com.dxt.rabbitmq.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class ConsumerAckConfig {
    public static final String EXCHANGE = "consumer_ack_exchange";
    public static final String QUEUE = "consumer_ack_queue";

    @Bean
    public FanoutExchange getAckExchange(){
        return new FanoutExchange(ConsumerAckConfig.EXCHANGE);
    }
    @Bean
    public Queue getAckQueue(){
        return new Queue(ConsumerAckConfig.QUEUE);
    }
    @Bean
    public Binding ackBinding(){
        return BindingBuilder.bind(getAckQueue()).to(getAckExchange());
    }
}
